// pages/goods/detail/index.js
import { GoodsDetail } from '../../../services/good/fetchGood';
Page({
	data: {
		goodsId: '',
		goodsDetail: {},
		soldout: false,
		jumpArray: [
			{
				url: '/pages/cart/index',
				iconName: 'cart',
				showCartNum: true,
			},
		],
	},
	onLoad(query) {
		const { goodsId } = query;
		this.setData({
			goodsId: goodsId,
		});
		this.getDetail(goodsId);
	},
	getDetail(goodsId) {
		GoodsDetail({ goodsId: goodsId }).then((res) => {
			if (res.code == '0000') {
				this.setData({
					goodsDetail: res.data
				});
			}
		})
	}
})
